package com.yjd.pub.merchant.dao.impl;

import com.yjd.comm.user.dto.MerchantSession;
import org.springframework.stereotype.Component;
import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.merchant.model.MerchantModel;
import com.yjd.pub.merchant.dao.IMerchantDao;

import java.util.Map;

/**
 * <b>description</b>：商户信息数据访问层 <br>
 * <b>time</b>：2017-08-11 17:29:51 <br>
 * <b>author</b>： yangchangyan@yijiedai.com
 */
@Component("merchantDao")
public class MerchantDaoImpl extends BaseDaoImpl implements IMerchantDao {

	private static final String SQLMAPNAMESPACE = MerchantModel.class.getName();
	private static final String PKNAME = "org_id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	@Override
	public MerchantSession getMerchantSession(Map<String, Object> paramMap) {
		return (MerchantSession) this.getSqlMap().queryForObject(getNamesapceToSqlmapPrefix() + "getMerchantSession", paramMap);
	}

	@Override
	public MerchantSession getMerchantMobileSession(Map<String, Object> paramMap) {
		return (MerchantSession) this.getSqlMap().queryForObject(getNamesapceToSqlmapPrefix() + "getMerchantMobileSession", paramMap);
	}
}
